package com.c.yinyuezhushou.MRetrofit;

import java.io.IOException;
import java.util.List;

import okhttp3.Request;
import okhttp3.Response;

public class Interceptor implements okhttp3.Interceptor {

    private List<String> list;
    public Interceptor(List<String> list) {
        this.list = list;
    }

    @Override
    public Response intercept(Chain chain) throws IOException {
        Request.Builder builder= chain.request().newBuilder();

        for (String s : list){
            builder.addHeader("Cookie",s);
        }
        return chain.proceed(builder.build());
    }
}
